package com.lpit.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lpit.mapper.FansMapper;
import com.lpit.pojo.Fans;
import com.lpit.result.ResponseResult;
import com.lpit.service.FansService;
import com.lpit.vo.FansVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 石智星
 * @version 1.0
 * @date 2023/7/6 11:05
 */
@Service
public class FansServiceImpl extends ServiceImpl<FansMapper, Fans> implements FansService {

    @Autowired
    private FansMapper fansMapper;

    /**
     * 查询用户粉丝信息
     *
     * @param page
     * @param pageSize
     * @param id
     * @return
     */
    @Override
    public ResponseResult list(Integer page, Integer pageSize, Integer id) {

        Page<FansVo> fansVoPage = fansMapper.queryByUserIdFansVoPage(new Page<>(page, pageSize), id);

        return new ResponseResult(200,fansVoPage,"success");
    }
}
